package com.moneytalks.blaze.poc.service.beans;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.moneytalks.blaze.poc.domain.Note;
import com.moneytalks.blaze.poc.domain.User;
import com.moneytalks.blaze.poc.service.NotebookService;

public class NotebookServiceBean implements NotebookService {

	@Autowired
	private SessionFactory sessionFactory;


	public void addNote(Note note) {
		sessionFactory.getCurrentSession().save(note);
	}
	
	@SuppressWarnings("unchecked")
	public List<Note> retrieveNotes(Long userid) {
		return sessionFactory.getCurrentSession().createCriteria(Note.class).list();
	}

	public User authenticate(String username, String password) {
		// TODO Auto-generated method stub
		return null;
	}	
}
